package test.fresh.things.junit;

import java.io.IOException;

public class Mule {
	// --- Instance Variables --------------------------------------------------
	private String name = null;
	private int age = 1;
	private int weight = 10;

	// --- Methods -------------------------------------------------------------
	/**
	 * doSomething
	 * 
	 * @return CapacityCoeficient of the mule
	 */
	// throws IOException
	public int calculateCapacityCoeficient(int coef) throws IOException {

		// throw new IOException();
		return age * weight * coef;
	}

	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof Mule)) {
			return false;
		}
		System.out.println("Mule equals() method");
		Mule an = (Mule) obj;
		return name.equals(an.getName());
	}

	@Override
	public String toString() {

		StringBuilder sb = new StringBuilder(50);
		sb.append("MULE description --> Name: ").append(name);
		sb.append(", Age: ").append(age);
		sb.append(", Weight: ").append(weight);
		return sb.toString();
	}

	// --- Constructors --------------------------------------------------------
	public Mule() {
		super();
	}

	public Mule(Mule an) {
		this(an.getName(), an.getAge(), an.getWeight());
	}

	public Mule(String name, int age, int weight) {
		this.name = name;
		this.age = age;
		this.weight = weight;
	}

	// --- Getters & Setters ---------------------------------------------------

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public int getWeight() {
		return weight;
	}

	public void setWeight(int weight) {
		this.weight = weight;
	}
}
